<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui"%>
<%@ taglib uri="/WEB-INF/tld/sys.tld" prefix="sys"%>
<%
    String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>${tabTitle}</title>
    <jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
<div class="Wrapper">
    <div>
        <div id="pageInTab" class="pageInTab">
            <form id="ins_cfg_info_edit_form_xyfl">
                <div class="fieldset1 tabel_col clearFix">
                    <div class="fieldBox col_33" id="searchPrjStsCdId">
                        <div class="label">机构名称</div>
                        <div class="field">
                            <select name="insId"  id="insId">
                                <option value="" selected="selected">--请选择--</option>
                                <c:forEach items="${insList}" var="opt">
                                    <option value="${opt.insId}">${opt.insName}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>

                    <input type="hidden" id="insList" value="${insList}">
                    <input type="hidden" id="insName">
                    <input type="hidden" id="insCode">
                </div>
                <div class="btnsBox" style="text-align: center;">
                    <span id="saveBtn"  class="sq-button sq-button-round">保存</span>
                    <span id="cancelBtn" class="sq-button sq-button-round">取消</span>
                </div>
            </form>
        </div>
    </div>
</div>

<script type="text/javascript">
    //关闭
    $('#cancelBtn').click(function(){
        frameElement.dialog.close();
    });
    //保存
    $('#saveBtn').click(function(){
        var insIdoptions = $("#insId option:selected");　//获取选中项
        var insId = insIdoptions.val();
        if (null==insId ||''==insId){return;}

        $.ajax({
            url:"<%=path%>/institution/nosigndate/updatenosigndate.do",
            data:JSON.stringify({
                insId:insId,
                insertFlag:true
                // insName:insName
            }),
            contentType:"application/json; charset=utf-8",
            dataType:"json",
            type:"post",
            async:false,
            cache:false,
            success: function (msg) {
                if (msg.success == 1) {
                    top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                    parent.$("#searchBtn").click();
                    frameElement.dialog.close();
                }else {
                    top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                }
                grid.reload()
            },
            error:function () {
                UIUtils.alertError("保存失败");
            }
        });

    });

</script>

</body>
</html>